home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Languages / Masm V6.11 / SAMPLES / NTSAMPLE / HELLO / HELLO.AS$ / HELLO.bin
Encoding:
Text File  |  1993-08-23  |  942 b   |  43 lines

  1. .386
  2. .MODEL flat, stdcall
  3.  
  4. STD_OUTPUT_HANDLE EQU -11
  5.  
  6. GetStdHandle PROTO NEAR32 stdcall,
  7.     nStdHandle:DWORD
  8.  
  9. WriteFile PROTO NEAR32 stdcall,
  10.     hFile:DWORD, lpBuffer:NEAR32, nNumberOfBytesToWrite:DWORD,
  11.     lpNumberOfBytesWritten:NEAR32, lpOverlapped:NEAR32
  12.  
  13. ExitProcess PROTO NEAR32 stdcall,
  14.     dwExitCode:DWORD
  15.  
  16. .STACK 4096
  17.  
  18. .DATA
  19.  
  20. msg DB "Hello, world.", 13, 10
  21. written DD 0
  22. hStdOut DD 0
  23.  
  24. .CODE
  25. _start:
  26.     INVOKE  GetStdHandle,
  27.         STD_OUTPUT_HANDLE      ; Standard output handle
  28.     mov hStdOut, eax
  29.  
  30.     INVOKE  WriteFile,
  31.         hStdOut,               ; File handle for screen
  32.         NEAR32 PTR msg,        ; Address of string
  33.         LENGTHOF msg,          ; Length of string
  34.         NEAR32 PTR written,    ; Bytes written
  35.         0                      ; Overlapped mode
  36.  
  37.     INVOKE  ExitProcess,
  38.         0                      ; Result code for parent process
  39.  
  40. PUBLIC _start
  41. END
  42.  
  43.